package com.xinqi.modules.sys.gpt.controller.app;

import com.xinqi.common.base.response.R;
import com.xinqi.common.satoken.utils.LoginHelper;
import com.xinqi.modules.sys.gpt.dto.rsp.DayCountResultDTO;
import com.xinqi.modules.sys.gpt.service.DayCountService;
import io.swagger.v3.oas.annotations.Operation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * APP -- 每日用户配额
 *
 * @author: yyzhen
 * @date: 2023/05/23
 */
@RestController
@RequestMapping("/app/day-count")
@RequiredArgsConstructor
public class DayCountAppController {
    private final DayCountService dayCountService;

    @Operation(summary = "获取用户今日配额")
    @GetMapping("/info")
    public R<DayCountResultDTO> info() {
        return R.data(dayCountService.findByUserAndInit(LoginHelper.getUserId()));
    }

}
